<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>0.0 0.0</title>
        <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&amp;appid=XXXXX"></script>
        <script type="text/javascript">
            //<![CDATA[
            var map;
            function parseCoords() {
                data = document.location.href.split("?");
                if (data.length < 2) {
                    res = new Array(0.0, 0.0, 17);
                } else {
                    c = data[1].split(",");
                    lat = c[0]; lng = c[1];
                    res = new Array(parseFloat(lat), parseFloat(lng), 7);
                };
                return res;
            };
            function clickFunc(marker, point) {
                document.title = parseFloat(point.Lat).toFixed(5) + " " + parseFloat(point.Lon).toFixed(5);
                map.removeMarkersAll();
                map.addMarker(point);
            };
            function initialize() {
                res = parseCoords();
                lat = res[0]; lng = res[1]; zoom = res[2];
                map = new YMap(document.getElementById("map_canvas"));
                map.addTypeControl();
                map.addZoomLong();
                map.addPanControl();
                centre = new YGeoPoint(lat, lng);
                map.drawZoomAndCenter(centre, zoom);
                if (lat != 0 || lng != 0) {
                    clickFunc(null, centre);
                };
                YEvent.Capture(map, EventsList.MouseClick, clickFunc);
            };
            //]]>
        </script>
    </head>
    <body onload="initialize();">
        <div id="map_canvas" style="width:300px; height:250px;"></div>
    </body>
</html>
